﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DemoApplication
{
    public partial class TreeAjax : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            String tag = Request.QueryString["tag"] ?? String.Empty;

            if (tag=="gettreedata")
            {
                Response.Write("[{id:123,caption:'aaa_1',url:'www.baidu1.com'},{id:222,caption:'aaa_2',url:'www.baidu2.com'}]");
            }
            if (tag=="ajaxCrossDomain")
            {
                String callbackFunName = Request["callback"] ?? string.Empty;
                String name = Request["name"] ?? string.Empty;
                String address = Request["address"] ?? string.Empty;
                string info = "[{name:'"+name+"_info',address:'"+address+"_info'}]";
                Response.Write(callbackFunName + "(" + info + ")");
            }
        }
    }
}